# -*- coding = utf-8 -*-
# @Time    : 2025/3/12 下午4:54
# @Author  : yqk
# @File    : 文件操作.py
# @Software: PyCharm

# f = open("test.txt","w") #打开文件，文件不存在就新建
# f.write("hello world")
# f.close() #关闭文件

# f = open("test.txt","r") #没有文件就报错

# cont = f.read(5)
# cont = f.readlines()
#
# j = 1
# for i,j in enumerate(cont):
#     print(i,j)

import os
os.rename( "test.txt","test2.txt")

